import React from 'react';
import cutcity from "./city.js"
class GetCity extends React.Component {
    state={
        city:''
    }
    render() { 
        return <div style={{
            display:"flex"
        }}>
            <div><i className='iconfont icon-maLoca'></i></div>
            <div>{this.state.city}</div>
        </div>;
    }

    // getLocalCity(){
        
    // }
    componentDidMount(){
        cutcity()// 返回的是promise对象
        .then(res=>{
            this.setState({
                city:res
            })
        })            
    
        // this.getLocalCity()
    }

}

 
export default GetCity;